<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<div class="button_area">
	<a href="order/order.info.action" class="button">添加</a>
	<a  class="button" onclick="GridOption.doDelete()" >删除</a>
	<a class="button">修改状态</a>
</div>

<div class="filter_area">
	<s:form>
		<tr>
			<td>
				<table>
					<s:textfield label="企业名称"  name="filter.companyName"
						size="10"></s:textfield>
					<s:textfield label="公司地址"  name="filter.address" size="10"></s:textfield>
				</table>
			</td>
			<td width="10px"></td>
			<td>
				<table>
					<s:textfield label="上单时间大于等于" id="first_time_ge"
						name="filter.firstTimeGE" size="10"></s:textfield>
					<s:textfield label="上单时间小于等于" id="first_time_le"
						name="filter.firstTimeLE" size="10"></s:textfield>
				</table>
			</td>
			<td width="10px"></td>
			<td>
				<table>
					<s:select list="#{'true':'是','false':'否'}" label="是否为过期用户"
						name="filter.expired">
					</s:select>
					<tr>
						<td align="right">
							<a href="javascript:void(0)" style="width: 100%" onclick="GridOption.doSearch()">搜索</a>
						</td>
					</tr>
				</table>
			</td>

		</tr>


	</s:form>
</div>
<br>

<script type="text/javascript">
var GridOption={        
			url:'order/order.list.action?'+$('form').serialize(),
    		colModel:[  
    				{label:'id',name:'orderId',index:'orderId',key:true, hidden:true},
    				{label:'订单编号',name:'orderSerial', width:110,index:'orderSerial',sortable:false,formatter:'showlink', formatoptions:{baseLinkUrl:'order/order.info.action'}},
    				{label:'签单人姓名',name:'customer.customerName', width:140,index:'customer.customerName',sortable:false},     
	        		{label:'签单人部门',name:'customer.section',width:160,index:'customer.section',sortable:false},
	        		{label:'签单人职位',name:'customer.position',index:'customer.position',sortable:false},
	        		{label:'签单人电话',name:'customer.phoneNumber',index:'customer.phoneNumber',sortable:false},  
	        		{label:'签单人邮箱',name:'customer.email',index:'customer.email',sortable:false},
	        		
	        		
	        		
	       			{label:'企业名称',name:'customer.custCompany.custCompanyName',index:'customer.custCompany.custCompanyName',required:true, width:100,editable:false},     
	        		{label:'企业地址',name:'customer.custCompany.address',index:'customer.custCompany.address', width:100,editable:false},   
	        		{label:'企业邮编',name:'customer.custCompany.postalCode',index:'customer.custCompany.postalCode', width:100,editable:false},    
	        		{label:'企业电话',name:'customer.custCompany.phoneNumber',index:'customer.custCompany.phoneNumber', width:100,editable:false},
	        		{label:'企业传真',name:'customer.custCompany.faxNumber',index:'customer.custCompany.faxNumber', width:100,editable:false},
	        		
	        		
	        		{label:'项目类型',name:'projectType.dictionaryName',width:110,index:'projectType.dictionaryName',sortable:false},
	        		{label:'项目信息',name:'projectDetail',index:'projectDetail',width:110,sortable:false},
	        		{label:'联系业务人员姓名',name:'employee.employeeName',width:160,index:'employee.employeeName',sortable:false},     
	        		{label:'上单时间',name:'dealDate',index:'dealDate',width:110,sortable:false,formatter:'date',formatoptions:{newformat:'Y-m-d'}},
	        		{label:'订单状态',name:'status.dictionaryName',index:'status.dictionaryName', width:100,editable:false} 
	        		
	       		],     
     		imgpath: '../theme/images/jqgrid/',      
    		pager: "#pjmap",   
      		multiselect: true,     
     		sortname: 'orderId',     
      		viewrecords: true,     
      		sortorder: "desc", 
      		datatype: 'json',      
      		jsonReader: {     
	      		root: "dataRows",
	      		repeatitems : false
     		},
    		width:$(document).width()-80,
    		height: $(document).height()-180,
    		doSearch:function(){
    			$("#list").setGridParam({url:'order/order.list.action?'+$('form').serialize()});
      			$("#list").trigger("reloadGrid");
    		},
    		doDelete:function(){
    		    var ids=jQuery("#list").jqGrid('getGridParam','selarrrow');
    		    if($.isEmptyObject(ids)){
    		    	return false;
    		    }
    			$("#list").delGridRow(ids,{url:'order/delete',caption:'请确认',msg:'确认删除所选的订单 吗?',bSubmit:'确认',bCancel:'取消',reloadAfterSubmit:true});
    		}
    };
     $(document).ready(function(){
		$('#first_time_ge').datepicker({dateFormat:'yy-m-d'});
		$('#first_time_le').datepicker({dateFormat:'yy-m-d'});
	});
</script>
